import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/components/labels/index.dart';
import 'package:im_flutter_sdk_example/jsonserialize/expert/home_data.dart';

class Header extends StatelessWidget {
  final HomeExpertData item;
  const Header({Key key, this.item}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 140,
      padding: EdgeInsets.fromLTRB(16, 21, 16, 0),
      decoration: BoxDecoration(
          color: Colors.white,
          border: Border(
              // 四个值 top right bottom left
              top: BorderSide(
                  // 设置单侧边框的样式
                  color: rgba(245, 245, 245, 1),
                  width: 1,
                  style: BorderStyle.solid))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            padding: EdgeInsets.only(right: 29),
            child: SizedBox(
              child: Column(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    SizedBox(
                      width: 62,
                      height: 62,
                      child: ClipOval(
                        child: Image.network(
                          '${item.photo}',
                          fit: BoxFit.cover,
                          width: 62,
                          height: 62,
                        ),
                      ),
                    ),
                  ]),
            ),
          ),
          Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
            Container(
              padding: EdgeInsets.only(bottom: 10),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.baseline,
                children: [
                  Padding(
                    padding: EdgeInsets.only(right: 15),
                    child: Text('${item.name}',
                        style: TextStyle(
                            color: rgba(68, 68, 68, 1),
                            fontSize: 27,
                            fontWeight: FontWeight.w600)),
                  ),
                  LabelExpertDetail(name: '云计算'),
                  LabelExpertDetail(name: '医疗')
                ],
              ),
            ),
            Text('${item.title}',
                style: TextStyle(color: rgba(68, 68, 68, 1), fontSize: 14)),
            Container(
              margin: EdgeInsets.only(
                bottom: 20,
              ),
              child: Text('${item.agent}',
                  style: TextStyle(color: rgba(68, 68, 68, 1), fontSize: 14)),
            ),
          ]),
        ],
      ),
    );
  }
}
